package com.example.vue20220225.controller;


import com.example.vue20220225.model.Power;
import com.example.vue20220225.service.PowerService;
import com.example.vue20220225.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/power")
public class PowerController {

    @Resource
    PowerService powerService;

    // 分页
    @RequestMapping("/querypowerlist")
    public Map<String,Object> querypowerlist(Power power){
        System.out.println(power.getPage());
        System.out.println(power.getRow());
        return powerService.querypowerlist(power);
    }

    @RequestMapping("/getFirstPowerlist")
    public Map<String,Object> getFirstPowerlist(){
        return powerService.getFirstPowerlist();
    }
    @RequestMapping("/addpower")
    public Map<String,Object> addpower(Power power){
        return powerService.addpower(power);
    }
    @RequestMapping("/editpower")
    public Map<String,Object> editpower(Power power){
        return powerService.editpower(power);
    }
    @RequestMapping("/deletepower")
    public Map<String,Object> deletepower(Power power){
        return powerService.deletepower(power);
    }
}
